/* cTileWindow.h
 * 8x8 Tile editor window.
 */
#ifndef __newmoon_ctilewindow_h
#define __newmoon_ctilewindow_h

class TileWindow;
#include "cMainWindow.h"

class TileWindow: public Window {
	public:
		static const u32 BGColours[];
		
		TileWindow(MainWindow *Parent);
		~TileWindow();
		void Redraw();
	
	protected:
		MainWindow *Parent;
		DrawBox *TileBox;
		ImgBuf *TileBuf;
		bool ShowGrid;
		GtkLabel *StatusLabel;
		GtkWidget *PalBox, *ZoomBox, *PageBox, *BGColBox, *GridBox;
		u32 Palette, Zoom, Page, BGColIdx;
	
	private:
		friend class MainWindow;
		
		void _Create(MainWindow *Parent);
		friend void cTileWindow_TileBoxConfigureEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventConfigure* Event, void *Win);
		friend void cTileWindow_TileBoxExposeEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventExpose* Event, void *Win);
		friend void cTileWindow_PalBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cTileWindow_ZoomBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cTileWindow_PageBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cTileWindow_BGColBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cTileWindow_GridBoxToggleEvent(GtkToggleButton *Box, gpointer Win);
		friend gboolean cTileWindow_DeleteEvent(GtkWidget *Widget, GdkEvent *Event, gpointer Win);
};
void cTileWindow_TileBoxConfigureEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventConfigure* Event, void *Win);
void cTileWindow_TileBoxExposeEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventExpose* Event, void *Win);
void cTileWindow_PalBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cTileWindow_ZoomBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cTileWindow_PageBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cTileWindow_BGColBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cTileWindow_GridBoxToggleEvent(GtkToggleButton *Box, gpointer Win);
gboolean cTileWindow_DeleteEvent(GtkWidget *Widget, GdkEvent *Event, gpointer Win);

#endif //__newmoon_ctilewindow_h
